package com.cqcetbbs.smartlab.cqcetbbs.utils;

import android.content.Context;
import android.content.SharedPreferences;

public class SpUtils {

	public static void setBooleanValues(Context context, String key, boolean value) {

		SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);
		sp.edit().putBoolean(key, value).commit();

	}

	public static boolean getBooleanValues(Context context, String key, boolean defValue) {

		SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);

		return sp.getBoolean(key, defValue);
	}

	public static void setStringValues(Context context, String key, String value) {

		SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);
		sp.edit().putString(key, value).commit();

	}

	public static String getStringValues(Context context, String key, String defValue) {

		SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);

		return sp.getString(key, defValue);
	}

}
